<a href="<?php echo $current?>newuser" class="btn">Create New User</a>
<div style="height: 10px;clear:both;display:block"></div>
<form id="searchForm" action="<?php echo current_url()?>">
	<?
	
	if($canSearch){
	?>
	<label>
		รหัสพนักงาน
	</label>
	
	<input type="text" class="inputText" name="UserID" value="<? echo (isset($_GET['UserID'])) ? $_GET['UserID']:""?>" />
	
	<label>
		ชื่อพนักงาน
	</label>
	<input type="text" class="inputText" name="SALES_NAME" value="<? echo (isset($_GET['SALES_NAME'])) ? $_GET['SALES_NAME']:""?>" />
	
	
	<input type="submit" value="ค้นหา" />
	<?
	}
	?>
</form>
<div class=" pagination">
        <ul class="pagination">
            <?
            echo $pagination->create_links();
            ?>
        </ul>    
    </div>
<table class="table table-striped table-bordered table-condensed"> <!-- cellspacing='0' is important, must stay -->

	<!-- Table Header -->
	<thead>
		<tr>
			<th style="width:5%">UserID</th>
			<th style="width:10%">ชือ</th>
			<th style="width:20%">email</th>
			<th style="width:10%">โทรศัพท์</th>
			<th style="width:10%">Login name</th>
			<?
			
			if($canEdit){
			?>
			<th style="width:5%">Edit Data</th>
			<th style="width:5%">Edit Authen</th>
			<?
			}
			?>
		</tr>
	</thead>
	<!-- Table Header -->
	
	<!-- Table Body -->
	<tbody>
<?
	if(!empty($userList)){
	?>
		<?
		
		foreach($userList as $in=>$val){
		?>
			<tr>
				<td><?php echo $val->UserID?></td>
				<td><?php echo $val->SALES_NAME?></td>
				<td><?php echo $val->EMAIL?></td>
				<td><?php echo $val->TELEPHONE?></td>
				<td><?php echo $val->Username?></td>
				
				<?
			if($canEdit){
			?>
				<td align="center"><a class="" href="<?php echo $current?>edit/<?php echo $val->UserID?>">
				Edit 
				</a></td>
					<td align="center"><a class="" href="<?php echo $current?>manageauthen/<?php echo $val->UserID?>">
				Edit 
				</a></td>
				<?
				}
				?>
			</tr>
		<?
		}
		?>
<?
	}else{
	?>
		<tr>
			<td colspan="6"><h2>ไม่พบข้อมูล</h2></td>
		</tr>
	<?
	}
	?>
	
	</tbody>
	
	<!-- Table Body -->

</table>
<div class=" pagination">
        <ul class="pagination">
            <?
            echo $pagination->create_links();
            ?>
        </ul>    
    </div>
    